﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Netfraction.Common.DataStorage;

namespace NetfractionHub.Settings
{
    public static class HubDataSource
    {
        private static DataSource _dataSource;

        private static void CreateDataSource()
        {
            if (_dataSource != null)
                return;

            Version curVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            _dataSource = new DataSource();

            _dataSource.Name = "Netfraction";
            _dataSource.Version = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}.{1}", curVersion.Major, curVersion.Minor);
            _dataSource.Guid = new Guid("7A7EE6C8-C2A3-480d-B697-2306AA03078F");
            _dataSource.Author = "darkKlor";
            _dataSource.SourceLicence = "GPL v2.0";
            _dataSource.UpdateUrl = "";
            _dataSource.SiteUrl = "http://netfraction.codeplex.com/";
        }

        public static DataSource Source
        {
            get
            {
                if (_dataSource == null)
                    CreateDataSource();

                return _dataSource;
            }
        }
    }
}
